package com.sxl.chapter.seven;

public class FieldResolution {
	
	interface Interface0 {
		int A =0;
	}
	interface Interface1 extends Interface0 {
		int A =1;
	}
	
	interface Interface2 {
		int A = 2;
	}
	
	static class Parent implements Interface1 ,Interface0 {
//		public static int A = 3;
	}
	
	static class Sub extends Parent implements Interface2 {
//		public static int A = 4;
	}
	

	static class DeadLoopClass {
		static {
			if (true)  {
				System.out.println(Thread.currentThread() + "init DeadLoopClass");
				int a = 0;
				while (true) {
//					a++;
//					if (a>10000) break; 
					
				}
			}
		}
		
	}
	
	public static void main (String[] args) {
		
//		System.out.println(Parent.A);
		
		Runnable script = new Runnable() {
			
			public void run () {
				System.out.println(Thread.currentThread() + " start");
				DeadLoopClass dc = new DeadLoopClass();
				System.out.println(Thread.currentThread() + " run over!");
			}
		};
		
		Thread th1 = new Thread(script);
		Thread th2 = new Thread(script);
		Thread th3 = new Thread(script);
		
		th1.start();
		th2.start();
		th3.start();
	}
}
